/*
using MyGeneration/Template/NHibernate (c) by Sharp 1.4
based on OHM (alvy77@hotmail.com)
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace DomainModel
{

	/// <summary>
	/// IOperator interface for NHibernate mapped table 'Operator'.
	/// </summary>
	public interface IOperator
	{
		#region Public Properties
		
		int O_id
		{
			get ;
			set ;
			  
		}
		
		string O_Workid
		{
			get ;
			set ;
			  
		}
		
		string O_Password
		{
			get ;
			set ;
			  
		}
		
		string O_Remark
		{
			get ;
			set ;
			  
		}
		
		DateTime O_Createtime
		{
			get ;
			set ;
			  
		}
		
		int O_Rid
		{
			get ;
			set ;
			  
		}
		
		byte O_DeleteFlag
		{
			get ;
			set ;
			  
		}
		
		int O_oid
		{
			get ;
			set ;
			  
		}
		
		DateTime O_addTime
		{
			get ;
			set ;
			  
		}
		
		int? O_lastOid
		{
			get ;
			set ;
			  
		}
		
		DateTime? O_lastTime
		{
			get ;
			set ;
			  
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
	}

	/// <summary>
	/// Operator object for NHibernate mapped table 'Operator'.
	/// </summary>
	[Serializable]
	public class Operator : ICloneable,IOperator
	{
		#region Member Variables

		protected int _o_id;
		protected string _o_workid;
		protected string _o_password;
		protected string _o_remark;
		protected DateTime _o_createtime;
		protected int _o_rid;
		protected byte _o_deleteflag;
		protected int _o_oid;
		protected DateTime _o_addtime;
		protected int? _o_lastoid;
		protected DateTime? _o_lasttime;
		protected bool _bIsDeleted;
		protected bool _bIsChanged;
		#endregion
		
		#region Constructors
		public Operator() {}
		
		public Operator(string pOWorkid, string pOPassword, string pORemark, DateTime pOCreatetime, int pORid, byte pODeleteFlag, int pOoid, DateTime pOaddTime, int? pOlastOid, DateTime? pOlastTime)
		{
			this._o_workid = pOWorkid; 
			this._o_password = pOPassword; 
			this._o_remark = pORemark; 
			this._o_createtime = pOCreatetime; 
			this._o_rid = pORid; 
			this._o_deleteflag = pODeleteFlag; 
			this._o_oid = pOoid; 
			this._o_addtime = pOaddTime; 
			this._o_lastoid = pOlastOid; 
			this._o_lasttime = pOlastTime; 
		}
		
		public Operator(string pOWorkid, string pOPassword, string pORemark, DateTime pOCreatetime, int pORid, byte pODeleteFlag, int pOoid, DateTime pOaddTime)
		{
			this._o_workid = pOWorkid; 
			this._o_password = pOPassword; 
			this._o_remark = pORemark; 
			this._o_createtime = pOCreatetime; 
			this._o_rid = pORid; 
			this._o_deleteflag = pODeleteFlag; 
			this._o_oid = pOoid; 
			this._o_addtime = pOaddTime; 
		}
		
		public Operator(int pOid)
		{
			this._o_id = pOid; 
		}
		
		#endregion
		
		#region Public Properties
		
		public virtual int O_id
		{
			get { return _o_id; }
			set { _bIsChanged |= (_o_id != value); _o_id = value; }
			
		}
		
		public virtual string O_Workid
		{
			get { return _o_workid; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("O_Workid", "O_Workid value, cannot contain more than 20 characters");
			  _bIsChanged |= (_o_workid != value); 
			  _o_workid = value; 
			}
			
		}
		
		public virtual string O_Password
		{
			get { return _o_password; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("O_Password", "O_Password value, cannot contain more than 20 characters");
			  _bIsChanged |= (_o_password != value); 
			  _o_password = value; 
			}
			
		}
		
		public virtual string O_Remark
		{
			get { return _o_remark; }
			set 
			{
			  if (value != null && value.Length > 800)
			    throw new ArgumentOutOfRangeException("O_Remark", "O_Remark value, cannot contain more than 800 characters");
			  _bIsChanged |= (_o_remark != value); 
			  _o_remark = value; 
			}
			
		}
		
		public virtual DateTime O_Createtime
		{
			get { return _o_createtime; }
			set { _bIsChanged |= (_o_createtime != value); _o_createtime = value; }
			
		}
		
		public virtual int O_Rid
		{
			get { return _o_rid; }
			set { _bIsChanged |= (_o_rid != value); _o_rid = value; }
			
		}
		
		public virtual byte O_DeleteFlag
		{
			get { return _o_deleteflag; }
			set { _bIsChanged |= (_o_deleteflag != value); _o_deleteflag = value; }
			
		}
		
		public virtual int O_oid
		{
			get { return _o_oid; }
			set { _bIsChanged |= (_o_oid != value); _o_oid = value; }
			
		}
		
		public virtual DateTime O_addTime
		{
			get { return _o_addtime; }
			set { _bIsChanged |= (_o_addtime != value); _o_addtime = value; }
			
		}
		
		public virtual int? O_lastOid
		{
			get { return _o_lastoid; }
			set { _bIsChanged |= (_o_lastoid != value); _o_lastoid = value; }
			
		}
		
		public virtual DateTime? O_lastTime
		{
			get { return _o_lasttime; }
			set { _bIsChanged |= (_o_lasttime != value); _o_lasttime = value; }
			
		}
		

		public virtual bool IsDeleted
		{
			get
			{
				return _bIsDeleted;
			}
			set
			{
				_bIsDeleted = value;
			}
		}
		
		public virtual bool IsChanged
		{
			get
			{
				return _bIsChanged;
			}
			set
			{
				_bIsChanged = value;
			}
		}
		
		#endregion 
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			Operator castObj = null;
			try
			{
				castObj = (Operator)obj;
			} catch(Exception) { return false; } 
			return ( castObj != null ) &&
				( this._o_id == castObj.O_id );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _o_id.GetHashCode();
			return hash; 
		}
		#endregion
		
		#region ICloneable methods
		
		public virtual object Clone()
		{
			return this.MemberwiseClone();
		}
		
		#endregion
	}
	
	#region Custom ICollection interface for Operator 

	
	public interface IOperatorCollection : ICollection
	{
		Operator this[int index]{	get; set; }
		void Add(Operator pOperator);
		void Clear();
	}
	
	[Serializable]
	public class OperatorCollection : IOperatorCollection
	{
		private IList<Operator> _arrayInternal;

		public OperatorCollection()
		{
			_arrayInternal = new List<Operator>();
		}
		
		public OperatorCollection( IList<Operator> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<Operator>();
			}
		}

		public Operator this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((Operator[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(Operator pOperator) { _arrayInternal.Add(pOperator); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<Operator> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
